package jn.chen.utils;

import org.springframework.web.multipart.MultipartFile;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
/**
 * @className: convertDocToDocx
 * @author: chenLin
 * @version: 1.0.0
 * @description:
 * @date: 24/11/8 008 17:58
 */
public class convertDocToDocx {

    public void convertDocToDocx(MultipartFile file) throws IOException {
        InputStream inputStream1 = file.getInputStream();
        XWPFDocument document = new XWPFDocument(inputStream1);
        try (FileOutputStream out = new FileOutputStream("G:\\file.docx")) {
            document.write(out);
        }
        inputStream1.close();
    }

}
